<!DOCTYPE html>
<html lang="en">
<head>
<title>WebView4Delphi: uWVTypeLibrary: Interface ICoreWebView2Settings</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="ICoreWebView2Settings"></span><h1 class="cio">Interface ICoreWebView2Settings</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section">Properties</div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uWVTypeLibrary.html">uWVTypeLibrary</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type ICoreWebView2Settings = interface(IUnknown)</code></p>
<h2 class="description">Description</h2>
<p>
 Defines properties that enable, disable, or modify WebView features. Changes to IsGeneralAutofillEnabled and IsPasswordAutosaveEnabled apply immediately, while other setting changes made after NavigationStarting event do not apply until the next top-level navigation. </p>
<p>


<p>&lt;see href=&quot;<a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2settings">https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2settings</a>&quot;&gt;See the ICoreWebView2Settings article.)</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">IUnknown</li>
<li class="thisitem">ICoreWebView2Settings</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_IsScriptEnabled-Integer-">Get_IsScriptEnabled</a></strong>(out IsScriptEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_IsScriptEnabled-Integer-">Set_IsScriptEnabled</a></strong>(IsScriptEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_IsWebMessageEnabled-Integer-">Get_IsWebMessageEnabled</a></strong>(out IsWebMessageEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_IsWebMessageEnabled-Integer-">Set_IsWebMessageEnabled</a></strong>(IsWebMessageEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_AreDefaultScriptDialogsEnabled-Integer-">Get_AreDefaultScriptDialogsEnabled</a></strong>(out AreDefaultScriptDialogsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_AreDefaultScriptDialogsEnabled-Integer-">Set_AreDefaultScriptDialogsEnabled</a></strong>(AreDefaultScriptDialogsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_IsStatusBarEnabled-Integer-">Get_IsStatusBarEnabled</a></strong>(out IsStatusBarEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_IsStatusBarEnabled-Integer-">Set_IsStatusBarEnabled</a></strong>(IsStatusBarEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_AreDevToolsEnabled-Integer-">Get_AreDevToolsEnabled</a></strong>(out AreDevToolsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_AreDevToolsEnabled-Integer-">Set_AreDevToolsEnabled</a></strong>(AreDevToolsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_AreDefaultContextMenusEnabled-Integer-">Get_AreDefaultContextMenusEnabled</a></strong>(out enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_AreDefaultContextMenusEnabled-Integer-">Set_AreDefaultContextMenusEnabled</a></strong>(enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_AreHostObjectsAllowed-Integer-">Get_AreHostObjectsAllowed</a></strong>(out allowed: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_AreHostObjectsAllowed-Integer-">Set_AreHostObjectsAllowed</a></strong>(allowed: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_IsZoomControlEnabled-Integer-">Get_IsZoomControlEnabled</a></strong>(out enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_IsZoomControlEnabled-Integer-">Set_IsZoomControlEnabled</a></strong>(enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Get_IsBuiltInErrorPageEnabled-Integer-">Get_IsBuiltInErrorPageEnabled</a></strong>(out enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Settings.html#Set_IsBuiltInErrorPageEnabled-Integer-">Set_IsBuiltInErrorPageEnabled</a></strong>(enabled: Integer): HResult; stdcall;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_IsScriptEnabled-Integer-"></span><code>function <strong>Get_IsScriptEnabled</strong>(out IsScriptEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Controls if running JavaScript is enabled in all future navigations in the WebView. This only affects scripts in the document. Scripts injected with `ExecuteScript` runs even if script is disabled. The default value is `TRUE`.

<p>\snippet SettingsComponent.cpp IsScriptEnabled </p>
<h6 class="description_section">Attributes</h6>
<dl class="attributes">
  <dt>GUID['{E562E4F0-D7FA-43AC-8D71-C05150499F00}']</dt>
  <dd></dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_IsScriptEnabled-Integer-"></span><code>function <strong>Set_IsScriptEnabled</strong>(IsScriptEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `IsScriptEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_IsWebMessageEnabled-Integer-"></span><code>function <strong>Get_IsWebMessageEnabled</strong>(out IsWebMessageEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The `IsWebMessageEnabled` property is used when loading a new HTML document. If set to `TRUE`, communication from the host to the top-level HTML document of the WebView is allowed using `PostWebMessageAsJson`, `PostWebMessageAsString`, and message event of `window.chrome.webview`. For more information, navigate to PostWebMessageAsJson. Communication from the top-level HTML document of the WebView to the host is allowed using the postMessage function of `window.chrome.webview` and `add_WebMessageReceived` method. For more information, navigate to [add_WebMessageReceived](/microsoft-edge/webview2/reference/win32/icorewebview2#add_webmessagereceived). If set to false, then communication is disallowed. `PostWebMessageAsJson` and `PostWebMessageAsString` fails with `E_ACCESSDENIED` and `window.chrome.webview.postMessage` fails by throwing an instance of an `Error` object. The default value is `TRUE`.

<p>\snippet ScenarioWebMessage.cpp IsWebMessageEnabled </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_IsWebMessageEnabled-Integer-"></span><code>function <strong>Set_IsWebMessageEnabled</strong>(IsWebMessageEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `IsWebMessageEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_AreDefaultScriptDialogsEnabled-Integer-"></span><code>function <strong>Get_AreDefaultScriptDialogsEnabled</strong>(out AreDefaultScriptDialogsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 `AreDefaultScriptDialogsEnabled` is used when loading a new HTML document. If set to `FALSE`, WebView2 does not render the default JavaScript dialog box (Specifically those displayed by the JavaScript alert, confirm, prompt functions and `beforeunload` event). Instead, if an event handler is set using `add_ScriptDialogOpening`, WebView sends an event that contains all of the information for the dialog and allow the host app to show a custom UI. The default value is `TRUE`. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_AreDefaultScriptDialogsEnabled-Integer-"></span><code>function <strong>Set_AreDefaultScriptDialogsEnabled</strong>(AreDefaultScriptDialogsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `AreDefaultScriptDialogsEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_IsStatusBarEnabled-Integer-"></span><code>function <strong>Get_IsStatusBarEnabled</strong>(out IsStatusBarEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 `IsStatusBarEnabled` controls whether the status bar is displayed. The status bar is usually displayed in the lower left of the WebView and shows things such as the URI of a link when the user hovers over it and other information. The default value is `TRUE`. The status bar UI can be altered by web content and should not be considered secure. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_IsStatusBarEnabled-Integer-"></span><code>function <strong>Set_IsStatusBarEnabled</strong>(IsStatusBarEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `IsStatusBarEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_AreDevToolsEnabled-Integer-"></span><code>function <strong>Get_AreDevToolsEnabled</strong>(out AreDevToolsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 `AreDevToolsEnabled` controls whether the user is able to use the context menu or keyboard shortcuts to open the DevTools window. The default value is `TRUE`. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_AreDevToolsEnabled-Integer-"></span><code>function <strong>Set_AreDevToolsEnabled</strong>(AreDevToolsEnabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `AreDevToolsEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_AreDefaultContextMenusEnabled-Integer-"></span><code>function <strong>Get_AreDefaultContextMenusEnabled</strong>(out enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The `AreDefaultContextMenusEnabled` property is used to prevent default context menus from being shown to user in WebView. The default value is `TRUE`.

<p>\snippet SettingsComponent.cpp DisableContextMenu </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_AreDefaultContextMenusEnabled-Integer-"></span><code>function <strong>Set_AreDefaultContextMenusEnabled</strong>(enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `AreDefaultContextMenusEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_AreHostObjectsAllowed-Integer-"></span><code>function <strong>Get_AreHostObjectsAllowed</strong>(out allowed: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The `AreHostObjectsAllowed` property is used to control whether host objects are accessible from the page in WebView. The default value is `TRUE`.

<p>\snippet SettingsComponent.cpp HostObjectsAccess </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_AreHostObjectsAllowed-Integer-"></span><code>function <strong>Set_AreHostObjectsAllowed</strong>(allowed: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `AreHostObjectsAllowed` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_IsZoomControlEnabled-Integer-"></span><code>function <strong>Get_IsZoomControlEnabled</strong>(out enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The `IsZoomControlEnabled` property is used to prevent the user from impacting the zoom of the WebView. When disabled, the user is not able to zoom using Ctrl++, Ctrl+-, or Ctrl+mouse wheel, but the zoom is set using `ZoomFactor` API. The default value is `TRUE`.

<p>\snippet SettingsComponent.cpp DisableZoomControl </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_IsZoomControlEnabled-Integer-"></span><code>function <strong>Set_IsZoomControlEnabled</strong>(enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `IsZoomControlEnabled` property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_IsBuiltInErrorPageEnabled-Integer-"></span><code>function <strong>Get_IsBuiltInErrorPageEnabled</strong>(out enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The `IsBuiltInErrorPageEnabled` property is used to disable built in error page for navigation failure and render process failure. When disabled, a blank page is displayed when the related error happens. The default value is `TRUE`.

<p>\snippet SettingsComponent.cpp BuiltInErrorPageEnabled </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Set_IsBuiltInErrorPageEnabled-Integer-"></span><code>function <strong>Set_IsBuiltInErrorPageEnabled</strong>(enabled: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Sets the `IsBuiltInErrorPageEnabled` property. </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>
